home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / PROGTOOL / PASSDK30.ZIP;1 / DISK1.ZIP / PAS / CDROMAPP / CDRESUME.C < prev    next >
Encoding:
C/C++ Source or Header  |  1993-01-08  |  1.2 KB  |  71 lines

  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <dos.h>
  4.  
  5. #define OKAY 0
  6.  
  7. #include "cdmaster.h"
  8.  
  9. char *syntax= "Syntax: cdresume [drive #].\n";
  10. char *nodrives= "No CDROM drives attached.\n";
  11. char *nomscdex= "MSCDEX is not installed.\n";
  12.  
  13. char *copyright= "cdresume.exe - Copyright Media Vision, 1992\n";
  14. char *programmer= "Bart Crane";
  15.  
  16. main(int argc, char **argv)
  17. {
  18.     int numcdroms= 0;
  19.     int ourdrive= 0;
  20.     struct cdtable *cdt;
  21.  
  22.     if (!ismscdex())
  23.         {
  24.         fprintf(stderr, nomscdex);
  25.         return(1);
  26.         }
  27.  
  28.     if (!(numcdroms= getnumcdroms()))
  29.         {
  30.         fprintf(stderr, nodrives);
  31.         return(2);
  32.         }
  33.  
  34.     switch (argc)
  35.         {
  36.         case 2:
  37.             if (!(ourdrive= atoi(argv[1])))
  38.                 {
  39.                 fprintf(stderr, syntax);
  40.                 return(3);
  41.                 }
  42.             break;
  43.  
  44.         case 1:
  45.             if (!(ourdrive= getfirstcdrom()))
  46.                 {
  47.                 fprintf(stderr, nodrives);
  48.                 return(4);
  49.                 }
  50.             break;
  51.  
  52.         default:
  53.             fprintf(stderr, syntax);
  54.             return(5);
  55.         }
  56.  
  57.     printf("resume drive: %2d ", ourdrive);
  58.  
  59.     if (cdt= createaudiotoc(ourdrive))
  60.         {
  61.         int status= cdresume(ourdrive);
  62.         printf("= %X.\n", status);
  63.         destroyaudiotoc(ourdrive);
  64.         }
  65.     else
  66.         printf("failed, no initialization.\n");
  67.  
  68.     return(OKAY);
  69. }
  70.  
  71.